<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="./lib/vue2.6.10.js"></script>
    <title>2</title>
    <style>
    [v-cloak]{
        display: none;
    }
    </style>
</head>
<body>
    <div id="app">
        <h2 v-cloak>{{msg}}</h2>
        <h2 v-text="msg"></h2>
        <hr>
        <!-- v-text 与插值表达式的区别
            v-text 会覆盖元素中的内容 插值则表达式只会替换标记块
         -->
        <p>++++{{msg}}----</p>
        <p v-text="msg">aaabbbcc</p>
        <hr>
        <p >{{htmlStr}}</p>
        <p v-text="htmlStr"></p>
        <p v-html="htmlStr"></p>
        <hr>
        <!-- v-bind: 绑定属性 v-on 绑定事件 -->
        <input type="button" value="按 钮" v-bind:title="title + 888" v-on:mouseover="open">
        <!-- 简写模式 -->
        <input type="button" value="按 钮" :title="title + 888" @click="open">
    </div>

    <script>
    var vm = new Vue({
        el:"#app",
        data:{
            msg :1231231,
            htmlStr: "<h1>我最大<h1>",
            title: "点我"
        },
        methods: { // 定义当前vue实例所有可用方法
            open: function(){
                alert('gogogo');
            }

        },

    });
        
    </script>
</body>
</html>